﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace Enterprise.Adapters
{
    /// <summary>
    /// Creates a nice indented meta tag instead of the messy original. It's also easier to debug this code.
    /// </summary>
    public class HtmlMetaAdapter : System.Web.UI.Adapters.ControlAdapter
    {
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlMeta metaTag = (HtmlMeta)this.Control;

            writer.Write("\t<meta name=\"");
            writer.Write(metaTag.Name);
            writer.Write("\" content=\"");
            writer.Write(metaTag.Content);
            writer.WriteLine("\" />");
        }
    } 
}
